﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:find="clr-namespace:DeepEarth.Toolkit.Controls"
    xmlns:commonControls="clr-namespace:DeepEarth.Toolkit.Common.Controls;assembly=DeepEarth.Toolkit.Common"
    >  
    <Style TargetType="find:FindControl">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="find:FindControl">
                    <Grid x:Name="LayoutRoot">
                        <ScrollViewer VerticalScrollBarVisibility="Auto">
                            <commonControls:HeaderedTemplatedItemsControl HideItemsWhenEmpty="true"
                                ItemsSource="{Binding SearchResultsSource, RelativeSource={RelativeSource TemplatedParent}}"
                                HeaderMemberPath="Source" ChildItemsSource="Results"
                                ItemTemplateSelector="{Binding TemplateSelector, RelativeSource={RelativeSource TemplatedParent}}"
                                HeaderTemplateSelector="{Binding HeaderTemplateSelector, RelativeSource={RelativeSource TemplatedParent}}"
                                ItemSelectedCommand="{Binding ItemSelectedCommand, RelativeSource={RelativeSource TemplatedParent}}" />
                        </ScrollViewer>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>